package top.haloiti.learnning.singleton;

/**
 * @Auther: 乔帅
 * @Date: 2020/9/13 15:24
 * @Description: 懒汉式
 */
public class LazySingleton {
    private static LazySingleton lazyInstance = null;

    private LazySingleton() {
    }

    // 对外提供获取实例的访问点
    public synchronized  static LazySingleton getInstance() {
        if (lazyInstance == null) {
            lazyInstance = new LazySingleton();
        }
        return lazyInstance;
    }
}
